package com.niiwoo.civet.scheduler.trigger;

import com.alibaba.dubbo.config.annotation.Reference;
import com.niiwoo.civet.trade.service.invest.InvestAddGroupDubboService;
import com.niiwoo.civet.trade.service.invest.InvestDubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by lixiang on 2017/11/22.
 */
@Component
public class InvestOrderJobTrigger {
	private static final Logger logger = LoggerFactory.getLogger(InvestOrderJobTrigger.class);

	@Reference(version = "1.0.0")
	private InvestDubboService investDubboService;
	@Reference(version = "1.0.0")
	private InvestAddGroupDubboService investAddGroupDubboService;

	@Scheduled(cron = "${invest.order-batch-process}")
	public void investOrderBatchProcess() {
		logger.info("投资订单状态变更job");
		investDubboService.investOrderBatchProcess();
	}

	@Scheduled(cron = "${invest.add-group-batch}")
	public void addGroupBatch() {
		logger.info("建群补单job");
		investAddGroupDubboService.addGroupBatch();
	}

}
